Accessing Java EE Scope Objects
From Documentation
This article is out of date, please refer to https://docs.zkoss.org/zk_dev_ref/ for more up to date information.
Executions
getCurrent
Retrieves the current execution which contains HTTP request/response.
get HttpServletRequest
HttpServletRequest req = (HttpServletRequest)Executions.getCurrent().getNativeRequest()
Sessions
Get Current Session
Retrieves the current ZK-wrapped session.
Get HttpSession
HttpSession nativeSession = (HttpSession) Sessions.getCurrent().getNativeSession();